#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main()
{
    vector<int> hash(10, 0);
    string nums;
    string ret;
    cin >> nums;
    for(int i = nums.size() - 1; i >= 0; i--)
    {
        if(hash[nums[i]] != 0) continue;
        hash[nums[i]] += 1;
        ret.push_back(nums[i]);
    }
    cout << ret << endl;
    return 0;
}